package com.calm.editor.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.calm.editor.api.ProjectService;
import com.calm.editor.entity.Project;
import com.calm.editor.servlet.Event;
@Service("project")
@Transactional
public class ProjectServiceImpl extends BaseServiceImpl<Project, Integer> implements ProjectService {
	@Event("loadProject")
	public Project getById(Integer id) {
		return super.getById(id);
	}

	@Event("saveProject")
	public void update(Project Project) {
		Project byId = getById(Project.getId());
		super.update(byId);
	}

	@Event("saveProject")
	@Transactional(readOnly=false)
	public void save(Project Project) {
		Project byId = getById(Project.getId());
		super.update(byId);
	}
	
	@Override
	public Class<Project> getEntityClass() {
		return Project.class;
	}

}
